<template>
  <div class="dialog">
    <div class="con">
      <h3>{{ title }}</h3>
      <p>
        <button @click="$emit('closeDialog')">{{ okValue }}</button>
      </p>
    </div>
  </div>
</template>

<script>
export default {
  // 推荐使用对象 最后不要数组
  props: {
    title: {
      type: String,  //类型检测
      default() { return '默认标题' }
    },
    okValue: {
      type: String,
      default: '确定'
    }
  }
}
</script>

<style scoped>
.dialog {
  width: 100%;
  height: 100%;
  position: fixed;
  left: 0;
  top: 0;
  background: rgba(0, 0, 0, .7);
}

.con {
  width: 60%;
  height: auto;
  padding: 20px;
  text-align: center;
  background: #fff;
  border-radius: 20px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}


</style>